<?php
	function connectToDB($hostname, $username, $password, $dbname)
	{
		// Create connection
		//connection to the database
		$dbhandle = mysql_connect($hostname, $username, $password) 
		  or die("Unable to connect to MySQL");
		  
		if (!mysql_select_db($dbname)) {
			echo "Não foi possível selecionar mydbname: " . mysql_error();
			exit;
		}	
	}
	
	function connectToProd()
	{
		$hostname = "mysql16.000webhost.com";
		$username = "a1491882_adm";
		$password = "rotondan0";
		$dbname = "a1491882_adm";		
		connectToDB($hostname, $username, $password, $dbname);
	}
	
	function connectToTest()
	{
		$hostname = "localhost";
		$username = "root";
		$password = "rotondan0";	
		$dbname = "test";	
		connectToDB($hostname, $username, $password, $dbname);
	}
?>